package com.banciyuan.bcywebview.biz.pc.zone.smooth;

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;
import android.os.Build;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.volley.RequestQueue;
import com.banciyuan.bcywebview.R;
import com.banciyuan.bcywebview.base.factory.TimelineFactory;
import com.banciyuan.bcywebview.base.helper.timelinedatacenter.DetailDataHelper;
import com.banciyuan.bcywebview.base.helper.timelinedatacenter.TimelineLikeHelper;
import com.banciyuan.bcywebview.base.view.tag.TagView;
import com.banciyuan.bcywebview.base.view.textview.EllipsezeTextView;
import com.banciyuan.bcywebview.biz.ask.AskActivity;
import com.banciyuan.bcywebview.biz.circles.smooth.CircleSmoothActivity;
import com.banciyuan.bcywebview.biz.circles.smooth.CircleTagSmoothActivity;
import com.banciyuan.bcywebview.biz.detail.goods.GoodsDetailActivity;
import com.banciyuan.bcywebview.biz.event.EventDetailActivity;
import com.banciyuan.bcywebview.biz.groupdetail.NewTeamDetailActivity;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.TimelineCardType;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.BaseView;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.GridDailyNoPicHolder;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.GridGroupHolder;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.GridGroupTeamHolder;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.GridLarticleHolder;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.GridPicHolder;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.GridVideoHolder;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.GridWriterHolder;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewArticle;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewAsk;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewAskMore;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewDaily;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewGoods;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewGroupTeam;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewHolder;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewPost;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewVideo;
import com.banciyuan.bcywebview.biz.main.mainpage.timeline.viewholder.ViewWriter;
import com.banciyuan.bcywebview.utils.common.UIUtils;
import com.banciyuan.bcywebview.utils.currency.CurrencyUtil;
import com.banciyuan.bcywebview.utils.http.VolleyQueue;
import com.banciyuan.bcywebview.utils.intent.gotoUtil;
import com.banciyuan.bcywebview.utils.string.NoLineClickSpan;
import com.banciyuan.bcywebview.utils.string.StringUtil;
import com.banciyuan.bcywebview.utils.universalimageloader.core.ImageLoader;
import com.banciyuan.bcywebview.utils.universalimageloader.utils.ImageOptions;

import java.util.ArrayList;
import java.util.List;

import de.greenrobot.daoexample.model.Detail;
import de.greenrobot.daoexample.model.TagDetail;
import de.greenrobot.daoexample.model.Timeline;

/**
 * Created by squall on 2016/10/9.
 */

public class PersonSmoothTimelineAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

    private Context mContext;
    private List<Timeline> clist = new ArrayList<>();
    private List<Timeline> gridList = new ArrayList<>();
    private RequestQueue mQueue;
    private HeaderFilter headerFilter;

    private boolean isAnimation_runing;

    public PersonSmoothTimelineAdapter(Context mContext, List<Timeline> clist, List<Timeline> gridList, HeaderFilter headerFilter, String type) {
        this.mContext = mContext;
        this.clist = clist;
        this.gridList = gridList;
        this.headerFilter = headerFilter;
        this.mQueue = VolleyQueue.getRquest(mContext);
    }

    @Override
    public int getItemViewType(int position) {
        if (!gridList.isEmpty()) {
            if (position == 0) {
                return TimelineCardType.FILTER_CARD;
            } else {
                Timeline mItem = gridList.get(position - 1);
                switch (TimelineFactory.whichType(mItem)) {
                    case TimelineFactory.TIMELINE_TYPE_ILLUST:
                    case TimelineFactory.TIMELINE_TYPE_COSER:
                    default:
                        return TimelineCardType.GRID_PIC;
                    case TimelineFactory.TIMELINE_TYPE_DAILY:
                        if (StringUtil.notNullEqual(mItem.getType(), "larticle")) {
                            return TimelineCardType.GRID_LARTICLE;
                        } else if (StringUtil.notNullEqual(mItem.getType(), "svideo")) {
                            return TimelineCardType.GRID_VIDEO;
                        } else {
                            if (TextUtils.isEmpty(mItem.getCover())) {
                                return TimelineCardType.GRID_DAILY_NOPIC;
                            } else {
                                return TimelineCardType.GRID_PIC;
                            }
                        }
                    case TimelineFactory.TIMELINE_TYPE_WRITER:
                        return TimelineCardType.GRID_WRITER;
                    case TimelineFactory.TIMELINE_TYPE_GROUP_TEAM:
                        return TimelineCardType.GRID_GROUP;
                    case TimelineFactory.TIMELINE_TYPE_GROUP:
                        return TimelineCardType.GRID_GROUP_POST;
                }
            }
        } else {
            if (position == 0) {
                return TimelineCardType.FILTER_CARD;
            } else {
                Timeline mItem = clist.get(position - 1);
                switch (TimelineFactory.whichType(mItem)) {
                    case TimelineFactory.TIMELINE_TYPE_ILLUST:
                    case TimelineFactory.TIMELINE_TYPE_COSER:
                    default:
                        return TimelineCardType.COSILL_CARD;
                    case TimelineFactory.TIMELINE_TYPE_DAILY:
                        if (StringUtil.notNullEqual(mItem.getType(), "larticle")) {
                            return TimelineCardType.ARTICLE_CARD;
                        } else if (StringUtil.notNullEqual(mItem.getType(), "svideo")) {
                            return TimelineCardType.VIDEO_CARD;
                        } else {
                            return TimelineCardType.DAILY_CARD;
                        }
                    case TimelineFactory.TIMELINE_TYPE_ASK:
                        if (null != mItem.getDetails() && mItem.getDetails().size() >= 3) {
                            return TimelineCardType.ASK_MORE_CARD;
                        } else {
                            return TimelineCardType.ASK_CARD;
                        }
                    case TimelineFactory.TIMELINE_TYPE_WRITER:
                        return TimelineCardType.WRITER_CARD;
                    case TimelineFactory.TIMELINE_TYPE_GROUP_TEAM:
                        return TimelineCardType.GROUP_CARD;
                    case TimelineFactory.TIMELINE_TYPE_GROUP:
                        return TimelineCardType.GROUP_POST_CARD;
                    case TimelineFactory.TIMELINE_TYPE_GOODS:
                        return TimelineCardType.GOODS_CARD;
                }
            }
        }
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        switch (viewType) {
            case TimelineCardType.COSILL_CARD:
            default:
                return new ViewHolder(View.inflate(mContext, R.layout.ground_list_item, null));
            case TimelineCardType.DAILY_CARD:
                return new ViewDaily(View.inflate(mContext, R.layout.new_daily_list_item, null));
            case TimelineCardType.ASK_CARD:
                return new ViewAsk(View.inflate(mContext, R.layout.timeline_ask_list_item, null));
            case TimelineCardType.WRITER_CARD:
                return new ViewWriter(View.inflate(mContext, R.layout.timeline_writer_list_item, null));
            case TimelineCardType.ASK_MORE_CARD:
                return new ViewAskMore(View.inflate(mContext, R.layout.timeline_ask_more_item, null));
            case TimelineCardType.GROUP_CARD:
                return new ViewGroupTeam(View.inflate(mContext, R.layout.timeline_groupteam_item, null));
            case TimelineCardType.GROUP_POST_CARD:
                return new ViewPost(View.inflate(mContext, R.layout.new_post_list_item, null));
            case TimelineCardType.GRID_PIC:
                return new GridPicHolder(View.inflate(mContext, R.layout.timeline_grid_pic, null));
            case TimelineCardType.GRID_DAILY_NOPIC:
                return new GridDailyNoPicHolder(View.inflate(mContext, R.layout.timeline_grid_daily_without_pic, null));
            case TimelineCardType.GRID_LARTICLE:
                return new GridLarticleHolder(View.inflate(mContext, R.layout.timeline_grid_larticle, null));
            case TimelineCardType.GRID_VIDEO:
                return new GridVideoHolder(View.inflate(mContext, R.layout.timeline_grid_video, null));
            case TimelineCardType.GRID_GROUP:
                return new GridGroupTeamHolder(View.inflate(mContext, R.layout.timeline_grid_group_team, null));
            case TimelineCardType.GRID_GROUP_POST:
                return new GridGroupHolder(View.inflate(mContext, R.layout.timeline_grid_group, null));
            case TimelineCardType.GRID_WRITER:
                return new GridWriterHolder(View.inflate(mContext, R.layout.timeline_grid_writer, null));
            case TimelineCardType.FILTER_CARD:
                return headerFilter;
            case TimelineCardType.GOODS_CARD:
                return new ViewGoods(View.inflate(mContext, R.layout.timeline_goods_item, null));
            case TimelineCardType.ARTICLE_CARD:
                return new ViewArticle(View.inflate(mContext, R.layout.timeline_article_item, null));
            case TimelineCardType.VIDEO_CARD:
                return new ViewVideo(View.inflate(mContext, R.layout.timeline_video_item, null));
        }
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        if (gridList.isEmpty()) {
            if (position >= 1) {
                int index = position - 1;
                Timeline mItem = clist.get(index);
                switch (getItemViewType(position)) {
                    case TimelineCardType.COSILL_CARD:
                    default:
                        ViewHolder viewHolder = (ViewHolder) holder;
                        setCosIllust(viewHolder, mItem, index);
                        break;
                    case TimelineCardType.DAILY_CARD:
                        ViewDaily viewDaily = (ViewDaily) holder;
                        setDaily(viewDaily, mItem, index);
                        break;
                    case TimelineCardType.ASK_CARD:
                        ViewAsk viewAsk = (ViewAsk) holder;
                        setAsk(viewAsk, mItem, index);
                        break;
                    case TimelineCardType.WRITER_CARD:
                        ViewWriter viewWriter = (ViewWriter) holder;
                        setWriter(viewWriter, mItem, index);
                        break;
                    case TimelineCardType.ASK_MORE_CARD:
                        ViewAskMore viewAskMore = (ViewAskMore) holder;
                        setAskMore(viewAskMore, mItem, index);
                        break;
                    case TimelineCardType.GROUP_CARD:
                        ViewGroupTeam viewGroupTeam = (ViewGroupTeam) holder;
                        setGroup(viewGroupTeam, mItem, index);
                        break;
                    case TimelineCardType.GROUP_POST_CARD:
                        ViewPost viewPost = (ViewPost) holder;
                        setGroupPost(viewPost, mItem, index);
                        break;
                    case TimelineCardType.GOODS_CARD:
                        ViewGoods viewGoods = (ViewGoods) holder;
                        setGoods(viewGoods, mItem, index);
                        break;
                    case TimelineCardType.ARTICLE_CARD:
                        ViewArticle viewArticle = (ViewArticle) holder;
                        setArticle(viewArticle, mItem, index);
                        break;
                    case TimelineCardType.VIDEO_CARD:
                        ViewVideo viewVideo = (ViewVideo) holder;
                        setVideo(viewVideo, mItem, index);
                        break;
                }
            }
        } else {
            if (position >= 1) {
                int index = position - 1;
                Timeline mItem = gridList.get(index);
                OnItemClick onclick = new OnItemClick(mItem);
                switch (getItemViewType(position)) {
                    case TimelineCardType.GRID_PIC:
                    default:
                        GridPicHolder gridPicHolder = (GridPicHolder) holder;
                        gridPicHolder.setGridPic(gridPicHolder, mItem, onclick);
                        break;
                    case TimelineCardType.GRID_DAILY_NOPIC:
                        GridDailyNoPicHolder gridDailyNoPicHolder = (GridDailyNoPicHolder) holder;
                        gridDailyNoPicHolder.setGridDailyNoPic(gridDailyNoPicHolder, mItem, onclick);
                        break;
                    case TimelineCardType.GRID_LARTICLE:
                        GridLarticleHolder gridLarticleHolder = (GridLarticleHolder) holder;
                        gridLarticleHolder.setGridarticle(gridLarticleHolder, mItem, onclick);
                        break;
                    case TimelineCardType.GRID_VIDEO:
                        GridVideoHolder gridVideoHolder = (GridVideoHolder) holder;
                        gridVideoHolder.setGridPic(gridVideoHolder, mItem, onclick);
                        break;
                    case TimelineCardType.GRID_GROUP:
                        GridGroupTeamHolder gridGroupTeamHolder = (GridGroupTeamHolder) holder;
                        gridGroupTeamHolder.setGridgroupTeam(gridGroupTeamHolder, mItem, onclick);
                        break;
                    case TimelineCardType.GRID_GROUP_POST:
                        GridGroupHolder gridGroupHolder = (GridGroupHolder) holder;
                        gridGroupHolder.setGridgroup(gridGroupHolder, mItem, onclick);
                        break;
                    case TimelineCardType.GRID_WRITER:
                        GridWriterHolder gridWriterHolder = (GridWriterHolder) holder;
                        gridWriterHolder.setGridWriter(gridWriterHolder, mItem, onclick);
                        break;
                }
            }
        }
    }

    @Override
    public int getItemCount() {
        if (!gridList.isEmpty()) {
            return gridList.size() + 1;
        } else {
            return clist.size() + 1;
        }
    }

    private void setOrgin(BaseView baseView, Timeline mItem) {
        baseView.head.setVisibility(View.GONE);
        baseView.name.setVisibility(View.GONE);
        if (StringUtil.notNullEqual(mItem.getUid(), mItem.getOuid()) || TextUtils.isEmpty(mItem.getUid())) {
            baseView.tuijian_label.setVisibility(View.GONE);
        } else {
            baseView.tuijian_label.setVisibility(View.VISIBLE);
        }
        ((View) (baseView.time.getParent())).setVisibility(View.VISIBLE);
        baseView.time.setText(StringUtil.getOppositeTime(mItem.getPushtime()));
    }

    private void setIntro(EllipsezeTextView tvIntro, Timeline mItem, String intro, String defaultIntro) {
        if (StringUtil.notNullEqual(mItem.getUid(), mItem.getOuid()) || TextUtils.isEmpty(mItem.getUid())) {
            setCommonIntro(tvIntro, intro);
        } else {
            setRecommendIntro(tvIntro, mItem, intro, defaultIntro);
        }
    }

    private void setCommonIntro(EllipsezeTextView tvIntro, String intro) {
        if (TextUtils.isEmpty(intro)) {
            tvIntro.setVisibility(View.GONE);
        } else {
            tvIntro.setVisibility(View.VISIBLE);
            tvIntro.setText(intro, "", "", false);
        }
    }

    private void setRecommendIntro(EllipsezeTextView tvIntro, Timeline mItem, String intro, String defaultIntro) {
        String finalIntro = TextUtils.isEmpty(intro) ? defaultIntro : intro;
        finalIntro = String.format(mContext.getResources().getString(R.string.card_recommended_user_format), mItem.getOUName(), finalIntro);
        tvIntro.setText(finalIntro, mItem.getOUName(), mItem.getOuid(), true);
        tvIntro.setVisibility(View.VISIBLE);
    }

    private void setBottom(BaseView baseView, final Timeline mItem) {
        if (!TextUtils.isEmpty(mItem.getCommentNum()) && baseView.commentNum != null) {
            if (Integer.parseInt(mItem.getCommentNum()) > 0) {
                baseView.commentNum.setText(mItem.getCommentNum());
            } else {
                baseView.commentNum.setText(mContext.getString(R.string.comment));
            }
        }
        if (StringUtil.getHaveDingBoolean(mItem)) {
            baseView.likeNumImg.setImageResource(R.drawable.like_pink);
            baseView.likeNum.setText(mItem.getLikeNum());
        } else {
            baseView.likeNumImg.setImageResource(R.drawable.like_grey);
            baseView.likeNum.setText(mItem.getLikeNum());
            if (mItem.getLikeNum().equals("0")) {
                baseView.likeNum.setText(mContext.getString(R.string.good));
            }
        }
        if (StringUtil.notNullEqual(mItem.getHaveRecommend(), "true")) {
            baseView.recommend.setText(mContext.getString(R.string.all_recommended));
        } else {
            baseView.recommend.setText(mContext.getString(R.string.all_recommend));
        }
    }

    private void setVideo(ViewVideo mViewVideo, Timeline mItem, int position) {
        ImageLoader.getInstance().displayImage(mItem.getContentAddress(), mViewVideo.content, ImageOptions.optionsTimeline, null, null, false);
        if (!TextUtils.isEmpty(mItem.getTitle())) {
            mViewVideo.title.setVisibility(View.VISIBLE);
            mViewVideo.title.setText(Html.fromHtml(mItem.getTitle()));
        } else {
            mViewVideo.title.setVisibility(View.GONE);
        }
        String defaultIntro = mContext.getString(R.string.post_video);
        try {
            String time = StringUtil.getTimeDuration((int) Double.parseDouble(mItem.getVideo_info().getDuration()));
            mViewVideo.pageNum.setText(time);
            mViewVideo.pageNum.setVisibility(View.VISIBLE);
        } catch (Exception e) {
            mViewVideo.pageNum.setVisibility(View.GONE);
        }
        setIntro(mViewVideo.intro, mItem, StringUtil.htmlDecoder(mItem.getSummary()), defaultIntro);
        setOrgin(mViewVideo, mItem);
        setBottom(mViewVideo, mItem);
        processTagData(mViewVideo, mItem, 0);
        OnClick groundOnClick = new OnClick(position);
        mViewVideo.head.setOnClickListener(groundOnClick);
        mViewVideo.title.setOnClickListener(groundOnClick);
        mViewVideo.name.setOnClickListener(groundOnClick);
        mViewVideo.recommendLayout.setOnClickListener(groundOnClick);
        mViewVideo.content.setOnClickListener(groundOnClick);
        mViewVideo.likeLayout.setOnClickListener(groundOnClick);
        mViewVideo.commentLayout.setOnClickListener(groundOnClick);
        mViewVideo.intro.setOnClickListener(groundOnClick);
    }

    private void setCosIllust(ViewHolder mViewHolder, Timeline mItem, int postion) {
        ImageLoader.getInstance().displayImage(mItem.getContentAddress(), mViewHolder.content, ImageOptions.optionsTimeline, null, null, true);
        if (!TextUtils.isEmpty(mItem.getPicNum())) {
            if (Integer.parseInt(mItem.getPicNum()) > 1) {
                mViewHolder.pageNum.setVisibility(View.VISIBLE);
            } else {
                mViewHolder.pageNum.setVisibility(View.GONE);
            }
        }
        String defaultIntro = TimelineFactory.whichType(mItem) == TimelineFactory.TIMELINE_TYPE_COSER ? mContext.getString(R.string.post_cos) : mContext.getString(R.string.post_draw);
        setIntro(mViewHolder.intro, mItem, mItem.getIntro(), defaultIntro);
        setOrgin(mViewHolder, mItem);
        setBottom(mViewHolder, mItem);
        processTagData(mViewHolder, mItem, 0);
        OnClick groundOnClick = new OnClick(postion);
        mViewHolder.head.setOnClickListener(groundOnClick);
        mViewHolder.name.setOnClickListener(groundOnClick);
        mViewHolder.recommendLayout.setOnClickListener(groundOnClick);
        mViewHolder.content.setOnClickListener(groundOnClick);
        mViewHolder.likeLayout.setOnClickListener(groundOnClick);
        mViewHolder.commentLayout.setOnClickListener(groundOnClick);
        mViewHolder.intro.setOnClickListener(groundOnClick);

    }

    private void setDaily(ViewDaily mViewDaily, Timeline mItem, int postion) {
        if (!TextUtils.isEmpty(mItem.getContentAddress())) {
            String[] addressList = mItem.getContentAddress().split(" ");
            if (addressList.length == 0) {
                mViewDaily.imagePics.setVisibility(View.GONE);
            } else {
                mViewDaily.imagePics.setVisibility(View.VISIBLE);
                for (int i = 0; i < mViewDaily.content.length; i++) {
                    LinearLayout.LayoutParams ll = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT);
                    if (addressList.length == 1) {
                        ll.weight = 2 - i;
                    } else {
                        ll.weight = 1;
                        if (i < 2) {
                            ll.rightMargin = UIUtils.dip2px(4, mContext);
                        }
                    }
                    mViewDaily.content[i].setLayoutParams(ll);
                    if (i < addressList.length) {
                        mViewDaily.content[i].setVisibility(View.VISIBLE);
                        ImageLoader.getInstance().displayImage(addressList[i], mViewDaily.content[i], ImageOptions.options);
                    } else {
                        if (addressList.length == 1) {
                            mViewDaily.content[i].setVisibility(View.INVISIBLE);
                        } else {
                            mViewDaily.content[i].setVisibility(View.GONE);
                        }
                    }
                }
            }
        } else {
            mViewDaily.imagePics.setVisibility(View.GONE);
        }
        String pic_num = mItem.getPic_num();
        if (!TextUtils.isEmpty(pic_num)) {
            if (Integer.parseInt(pic_num) > 3) {
                mViewDaily.pagenum.setVisibility(View.VISIBLE);
            } else {
                mViewDaily.pagenum.setVisibility(View.GONE);
            }
        } else {
            mViewDaily.pagenum.setVisibility(View.GONE);
        }
        setIntro(mViewDaily.intro, mItem, mItem.getIntro(), mContext.getString(R.string.write_name));
        setOrgin(mViewDaily, mItem);
        setBottom(mViewDaily, mItem);
        if (TimelineFactory.whichType(mItem) == TimelineFactory.TIMELINE_TYPE_DAILY) {
            processTagData(mViewDaily, mItem, 0);
        } else {
            mViewDaily.tags.setVisibility(View.GONE);
        }
        OnClick dailyOnClick = new OnClick(postion);
        mViewDaily.head.setOnClickListener(dailyOnClick);
        mViewDaily.name.setOnClickListener(dailyOnClick);
        mViewDaily.intro.setOnClickListener(dailyOnClick);
        mViewDaily.recommendLayout.setOnClickListener(dailyOnClick);
        mViewDaily.likeLayout.setOnClickListener(dailyOnClick);
        mViewDaily.commentLayout.setOnClickListener(dailyOnClick);
        mViewDaily.imagePics.setOnClickListener(dailyOnClick);
        mViewDaily.teamNameLayout.setOnClickListener(dailyOnClick);
    }


    private void setGroupPost(ViewPost mViewPost, Timeline mItem, int postion) {
        setOrgin(mViewPost, mItem);
        setBottom(mViewPost, mItem);
        mViewPost.teamName.setText(StringUtil.htmlDecoder(mItem.getGname()));
        if (!TextUtils.isEmpty(mItem.getContentAddress())) {
            String[] addressList = mItem.getContentAddress().split(" ");
            if (addressList.length == 0) {
                mViewPost.imagePics.setVisibility(View.GONE);
            } else {
                mViewPost.imagePics.setVisibility(View.VISIBLE);
                for (int i = 0; i < mViewPost.content.length; i++) {
                    if (i < addressList.length) {
                        mViewPost.content[i].setVisibility(View.VISIBLE);
                        ImageLoader.getInstance().displayImage(addressList[i], mViewPost.content[i], ImageOptions.options);
                    } else {
                        mViewPost.content[i].setVisibility(View.INVISIBLE);
                    }
                }
            }
        } else {
            mViewPost.imagePics.setVisibility(View.GONE);
        }
        String pic_num = mItem.getPic_num();
        if (!TextUtils.isEmpty(pic_num)) {
            if (Integer.parseInt(pic_num) > 3) {
                mViewPost.pagenum.setVisibility(View.VISIBLE);
            } else {
                mViewPost.pagenum.setVisibility(View.GONE);
            }
        } else {
            mViewPost.pagenum.setVisibility(View.GONE);
        }
        setIntro(mViewPost.intro, mItem, mItem.getIntro(), mContext.getString(R.string.post_topic));
        mViewPost.tags.setVisibility(View.GONE);
        OnClick dailyOnClick = new OnClick(postion);
        mViewPost.head.setOnClickListener(dailyOnClick);
        mViewPost.name.setOnClickListener(dailyOnClick);
        mViewPost.intro.setOnClickListener(dailyOnClick);
        mViewPost.recommendLayout.setOnClickListener(dailyOnClick);
        mViewPost.likeLayout.setOnClickListener(dailyOnClick);
        mViewPost.commentLayout.setOnClickListener(dailyOnClick);
        mViewPost.imagePics.setOnClickListener(dailyOnClick);
        mViewPost.teamNameLayout.setOnClickListener(dailyOnClick);
    }

    private void setAsk(ViewAsk mViewAsk, Timeline mItem, int postion) {
        setOrgin(mViewAsk, mItem);
        setBottom(mViewAsk, mItem);
        Detail detail = mItem.getDetail();
        if (null != detail) {
            String cavatar = detail.getCavatar();
            doAskHeadPic(detail, mViewAsk.answerHead, cavatar);
        }
        if (StringUtil.notNullEqual(mItem.getUid(), mItem.getOuid()) || TextUtils.isEmpty(mItem.getUid())) {
            mViewAsk.answer.setText(mItem.getContentAddress());
        } else {
            setRecommendAnswer(mViewAsk, mItem);
        }
        if (StringUtil.notNullEqual("0", mItem.getDp_id())) {
            mViewAsk.ask.setText(mItem.getIntro());
        } else {
            mViewAsk.ask.setText(mItem.getIntro());
        }
        OnClick askOnClick = new OnClick(postion);
        mViewAsk.head.setOnClickListener(askOnClick);
        mViewAsk.name.setOnClickListener(askOnClick);
        mViewAsk.recommendLayout.setOnClickListener(askOnClick);
        mViewAsk.likeLayout.setOnClickListener(askOnClick);
        mViewAsk.commentLayout.setOnClickListener(askOnClick);
        mViewAsk.answerHead.setOnClickListener(askOnClick);
        mViewAsk.container.setOnClickListener(askOnClick);
    }

    private void setRecommendAnswer(ViewAsk mViewAsk, Timeline mItem) {
        String answer = mItem.getContentAddress();
        answer = String.format(mContext.getResources().getString(R.string.card_recommended_user_format), mItem.getOUName(), answer);
        SpannableString sps = new SpannableString(answer);
        NoLineClickSpan no = new NoLineClickSpan(mItem.getOuid(), mContext, R.color.blue);
        sps.setSpan(no, 0, mItem.getOUName().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        mViewAsk.answer.setText(sps);
        mViewAsk.answer.setMovementMethod(LinkMovementMethod.getInstance());
    }

    private void setWriter(ViewWriter mViewWriter, Timeline mItem, int postion) {
        ImageLoader.getInstance().displayImage(mItem.getContentAddress(), mViewWriter.content, ImageOptions.options, null, null, true);
        setOrgin(mViewWriter, mItem);
        setBottom(mViewWriter, mItem);
        processTagData(mViewWriter, mItem, 0);
        mViewWriter.tvWriterDesc.setText(Html.fromHtml(mItem.getTitle()));
        setIntro(mViewWriter.intro, mItem, mItem.getIntro(), mContext.getString(R.string.post_write));
        if (!TextUtils.isEmpty(mItem.getSummary())) {
            mViewWriter.summery.setText(Html.fromHtml(mItem.getSummary()).toString().trim().replaceAll("(\\n)+", "\n"));
            mViewWriter.ellipsis.setText("......");
        }
        if ("true".equals(mItem.getPost_in_set())) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                mViewWriter.ivSeries.setImageDrawable(mContext.getResources().getDrawable(R.drawable.timeline_serise, mContext.getTheme()));
            } else {
                mViewWriter.ivSeries.setImageDrawable(mContext.getResources().getDrawable(R.drawable.timeline_serise));
            }
        } else {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                mViewWriter.ivSeries.setImageDrawable(mContext.getResources().getDrawable(R.drawable.timeline_single_write, mContext.getTheme()));
            } else {
                mViewWriter.ivSeries.setImageDrawable(mContext.getResources().getDrawable(R.drawable.timeline_single_write));
            }
        }
        OnClick writerOnClick = new OnClick(postion);
        mViewWriter.likeLayout.setOnClickListener(writerOnClick);
        mViewWriter.head.setOnClickListener(writerOnClick);
        mViewWriter.recommendLayout.setOnClickListener(writerOnClick);
        mViewWriter.content.setOnClickListener(writerOnClick);
        mViewWriter.commentLayout.setOnClickListener(writerOnClick);
        mViewWriter.name.setOnClickListener(writerOnClick);
        mViewWriter.intro.setOnClickListener(writerOnClick);
    }

    private void setAskMore(ViewAskMore mViewAskMore, Timeline mItem, int postion) {
        mViewAskMore.head.setVisibility(View.GONE);
        mViewAskMore.name.setVisibility(View.GONE);
        mViewAskMore.time.setText(StringUtil.getOppositeTime(mItem.getPushtime()));
        List<Detail> details = mItem.getDetails();

        if (null != details && details.size() >= 3) {
            String asknum = details.get(0).getAsk();
            mViewAskMore.ask_more_nums.setText(String.format(mContext.getString(R.string.askmore), String.valueOf(details.size())));
            mViewAskMore.tvAskmoreAskone.setText(asknum);
            mViewAskMore.tvAskmoreAsktwo.setText(details.get(1).getAsk());
            mViewAskMore.tvAskmoreAskthree.setText(details.get(2).getAsk());

            mViewAskMore.tvAskmoreAnswerone.setText(details.get(0).getContentAddress());
            mViewAskMore.tvAskmoreAnswertwo.setText(details.get(1).getContentAddress());
            mViewAskMore.tvAskmoreAnswerthree.setText(details.get(2).getContentAddress());

            String firstHead = details.get(0).getCavatar();
            String secondHead = details.get(1).getCavatar();
            String thirdHead = details.get(2).getCavatar();
            doAskHeadPic(details.get(0), mViewAskMore.firstHead, firstHead);
            doAskHeadPic(details.get(1), mViewAskMore.secondHead, secondHead);
            doAskHeadPic(details.get(2), mViewAskMore.thirdHead, thirdHead);
        }

        OnClick askMoreOnClick = new OnClick(postion);
        mViewAskMore.head.setOnClickListener(askMoreOnClick);
        mViewAskMore.ll.setOnClickListener(askMoreOnClick);
        mViewAskMore.name.setOnClickListener(askMoreOnClick);
        mViewAskMore.firstHead.setOnClickListener(askMoreOnClick);
        mViewAskMore.secondHead.setOnClickListener(askMoreOnClick);
        mViewAskMore.thirdHead.setOnClickListener(askMoreOnClick);
    }

    private void doAskHeadPic(Detail detail, ImageView ivHead, String headUrl) {
        if ("1".equals(detail.getAnonymous())) {
            ivHead.setImageResource(R.drawable.user_pic_anonymous);
        } else {
            if (StringUtil.notNullStartWithUrlHead(headUrl))
                ImageLoader.getInstance().displayImage(headUrl,
                        ivHead, ImageOptions.optionHead);
            else
                ivHead.setImageResource(R.drawable.user_pic_big);
        }
    }

    private void setGroup(ViewGroupTeam mViewGroupTeam, Timeline mItem, int position) {
        setOrgin(mViewGroupTeam, mItem);
        mViewGroupTeam.tvGroupTeamTitle.setText(Html.fromHtml(mItem.getGroupTitle()));
        if ("0".equals(mItem.getPost_num())) {
            mViewGroupTeam.tvGroupTeamJoin.setText(mContext.getString(R.string.post_message));
        } else {
            mViewGroupTeam.tvGroupTeamJoin.setText(String.format(mContext.getString(R.string.join_talk_card), mItem.getPost_num()));
        }
        if (TextUtils.isEmpty(mItem.getContentAddress())) {
            mViewGroupTeam.ivGroupCover.setVisibility(View.GONE);
        } else {
            mViewGroupTeam.ivGroupCover.setVisibility(View.VISIBLE);
            ImageLoader.getInstance().displayImage(mItem.getContentAddress(), mViewGroupTeam.ivGroupCover, ImageOptions.options);
        }
        if (TextUtils.isEmpty(mItem.getIntro())) {
            mViewGroupTeam.tvGroupTeamDesc.setVisibility(View.GONE);
        } else {
            mViewGroupTeam.tvGroupTeamDesc.setVisibility(View.VISIBLE);
            mViewGroupTeam.tvGroupTeamDesc.setText(Html.fromHtml(mItem.getIntro()));
        }
        OnClick viewGroupTeamOnClick = new OnClick(position);
        mViewGroupTeam.head.setOnClickListener(viewGroupTeamOnClick);
        mViewGroupTeam.name.setOnClickListener(viewGroupTeamOnClick);
        mViewGroupTeam.viewBody.setOnClickListener(viewGroupTeamOnClick);
    }

    private void setGoods(ViewGoods viewGoods, Timeline mItem, int position) {
        ImageLoader.getInstance().displayImage(mItem.getContentAddress(), viewGoods.content, ImageOptions.optionsDetail, null, null, true);
        if (!TextUtils.isEmpty(mItem.getTitle())) {
            ((View) (viewGoods.goodsName.getParent())).setVisibility(View.VISIBLE);
            viewGoods.goodsName.setText(Html.fromHtml(mItem.getTitle()).toString());
        } else {
            ((View) (viewGoods.goodsName.getParent())).setVisibility(View.GONE);
        }
        if (!TextUtils.isEmpty(mItem.getPrice())) {
            viewGoods.price.setText(String.format(mContext.getString(R.string.price_format), CurrencyUtil.getMoney(mItem.getPrice())));
        }
        setIntro(viewGoods.intro, mItem, mItem.getIntro(), mContext.getResources().getString(R.string.post_goods));
        viewGoods.tags.setVisibility(View.GONE);
        setOrgin(viewGoods, mItem);
        setBottom(viewGoods, mItem);
        OnClick groundOnClick = new OnClick(position);
        viewGoods.head.setOnClickListener(groundOnClick);
        viewGoods.name.setOnClickListener(groundOnClick);
        viewGoods.recommendLayout.setOnClickListener(groundOnClick);
        ((View) (viewGoods.content.getParent())).setOnClickListener(groundOnClick);
        viewGoods.likeLayout.setOnClickListener(groundOnClick);
        viewGoods.buyLayout.setOnClickListener(groundOnClick);
        viewGoods.intro.setOnClickListener(groundOnClick);
    }

    private void setArticle(ViewArticle mViewArticle, Timeline mItem, int position) {
        ImageLoader.getInstance().displayImage(mItem.getContentAddress(), mViewArticle.content, ImageOptions.optionsTimeline, null, null, true);
        mViewArticle.pageNum.setVisibility(View.GONE);
        if (!TextUtils.isEmpty(mItem.getTitle())) {
            mViewArticle.title.setVisibility(View.VISIBLE);
            mViewArticle.title.setText(Html.fromHtml(mItem.getTitle()));
        } else {
            mViewArticle.title.setVisibility(View.GONE);
        }
        if (!TextUtils.isEmpty(mItem.getOUName())) {
            mViewArticle.author.setVisibility(View.VISIBLE);
            mViewArticle.author.setText(mItem.getOUName());
        } else {
            mViewArticle.author.setVisibility(View.GONE);
        }
        if (!TextUtils.isEmpty(mItem.getSummary())) {
            mViewArticle.summary.setText(StringUtil.htmlDecoder(mItem.getSummary()));
        } else {
            mViewArticle.summary.setText(mContext.getString(R.string.post_article));
        }
        setOrgin(mViewArticle, mItem);
        setBottom(mViewArticle, mItem);
        processTagData(mViewArticle, mItem, 0);
        OnClick groundOnClick = new OnClick(position);
        mViewArticle.head.setOnClickListener(groundOnClick);
        mViewArticle.name.setOnClickListener(groundOnClick);
        mViewArticle.recommendLayout.setOnClickListener(groundOnClick);
        mViewArticle.content.setOnClickListener(groundOnClick);
        mViewArticle.likeLayout.setOnClickListener(groundOnClick);
        mViewArticle.commentLayout.setOnClickListener(groundOnClick);
        ((View) (mViewArticle.title.getParent())).setOnClickListener(groundOnClick);
    }

    private void processTagData(BaseView baseView, final Timeline mItem, final int from) {
        if (mItem.getTags() != null && mItem.getTags().size() > 0) {
            baseView.tags.setVisibility(View.VISIBLE);
        } else {
            baseView.tags.setVisibility(View.GONE);
        }
        if (mItem.getTags() != null && mItem.getTags().size() > 0) {
            baseView.tags.setTlist(mItem.getTags());
            baseView.tags.setTagViewClick(new TagView.OnTagClickListener() {
                @Override
                public void onClick(TagDetail t) {
                    if (!TextUtils.isEmpty(t.getWork())) {
                        if (!TextUtils.isEmpty(t.getWid())) {
                            Intent intent = new Intent(mContext, CircleSmoothActivity.class);
                            intent.putExtra(gotoUtil.INTENT_VALUE_ONE, t.getWork());
                            intent.putExtra(gotoUtil.INTENT_VALUE_TWO, t.getWid());
                            intent.putExtra("from", from);
                            mContext.startActivity(intent);
                        }
                    } else if (!TextUtils.isEmpty(t.getEvent_id())) {
                        gotoUtil.gotoAct(mContext, EventDetailActivity.class, t.getEvent_id());
                    } else {
                        Intent intent = new Intent(mContext, CircleTagSmoothActivity.class);
                        intent.putExtra(gotoUtil.INTENT_VALUE_ONE, t.getTag_name());
                        intent.putExtra("type", "tag");
                        intent.putExtra("from", from);
                        mContext.startActivity(intent);
                    }
                }
            });
        }
    }

    private class OnClick implements View.OnClickListener {

        int position;
        Timeline mItem;
        int timelineType;

        public OnClick(int position) {
            this.position = position;
            this.mItem = clist.get(position);
            timelineType = TimelineFactory.whichType(mItem);
        }

        @Override
        public void onClick(final View v) {
            switch (v.getId()) {
                case R.id.group_view_container:
                case R.id.daily_teamname_rly:
                    gotoUtil.gotoAct(mContext, NewTeamDetailActivity.class, mItem.getGid(), mItem.getGname());
                    break;
                case R.id.ground_name_tv:
                case R.id.ground_head_img:
                    gotoUtil.gotoAct(mContext, SmoothPersonActivity.class, mItem.getUid());
                    break;
                case R.id.timeline_answer_head_img:
                    if ("1".equals(mItem.getDetail().getAnonymous())) return;
                    gotoUtil.gotoAct(mContext, SmoothPersonActivity.class, mItem.getDetail().getCuid());
                    break;
                case R.id.civ_askmore_one:
                    if ("1".equals(mItem.getDetails().get(0).getAnonymous())) return;
                    gotoUtil.gotoAct(mContext, SmoothPersonActivity.class, mItem.getDetails().get(0).getCuid());
                    break;
                case R.id.civ_askmore_two:
                    if ("1".equals(mItem.getDetails().get(1).getAnonymous())) return;
                    gotoUtil.gotoAct(mContext, SmoothPersonActivity.class, mItem.getDetails().get(1).getCuid());
                    break;
                case R.id.civ_askmore_three:
                    if ("1".equals(mItem.getDetails().get(2).getAnonymous())) return;
                    gotoUtil.gotoAct(mContext, SmoothPersonActivity.class, mItem.getDetails().get(2).getCuid());
                    break;
                case R.id.ground_content_img:
                case R.id.ground_intro_tv:
                case R.id.ground_intro_content:
                case R.id.ground_content_rly:
                case R.id.article_click:
                case R.id.daily_teamname_tv:
                    switch (timelineType) {
                        case TimelineFactory.TIMELINE_TYPE_COSER:
                            DetailDataHelper.gotoCosDetail(mContext, mItem.getRp_id(), mItem.getCp_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_ILLUST:
                            DetailDataHelper.gotoDrawerDetail(mContext, mItem.getRp_id(), mItem.getDp_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_WRITER:
                            DetailDataHelper.gotoWriterDetail(mContext, mItem.getRp_id(), mItem.getWp_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_GOODS:
                            gotoUtil.gotoAct(mContext, GoodsDetailActivity.class, mItem.getZg_id());
                            break;
                        case TimelineFactory.TIMELINE_TYPE_DAILY:
                            DetailDataHelper.gotoDailyDetail(mContext, mItem.getUd_id(), false);
                            break;
                    }
                    break;
                case R.id.daily_intro_tv:
                case R.id.rl_daily_pics:
                    switch (timelineType) {
                        case TimelineFactory.TIMELINE_TYPE_DAILY:
                            DetailDataHelper.gotoDailyDetail(mContext, mItem.getUd_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_GROUP:
                            DetailDataHelper.gotoGroupDetail(mContext, mItem.getGid(), mItem.getPost_id(), false);
                            break;
                    }
                    break;
                case R.id.ground_like_rly:
                    if (isAnimation_runing) return;
                    TimelineLikeHelper.doLikeAll(mContext, mQueue, mItem, new TimelineLikeHelper.TimelineSuccess() {
                        @Override
                        public void onTimelineSuccess() {
                            if (!Boolean.parseBoolean(mItem.getHaveDing())) {
                                mItem.setHaveDing(String.valueOf(true));
                                mItem.setLikeNum(StringUtil.getString(
                                        StringUtil.getInt(mItem.getLikeNum()) + 1));
                            } else {
                                mItem.setHaveDing(String.valueOf(false));
                                mItem.setLikeNum(StringUtil.getString(
                                        StringUtil.getInt(mItem.getLikeNum()) - 1));
                            }
                            updateLike(v, mItem);
                        }
                    });
                    break;
                case R.id.ll:
                    gotoUtil.gotoAct(mContext, AskActivity.class, mItem.getOuid(), mItem.getOUName());
                    break;
                case R.id.ground_comment_rly:
                    switch (timelineType) {
                        case TimelineFactory.TIMELINE_TYPE_COSER:
                            DetailDataHelper.gotoCosDetail(mContext, mItem.getRp_id(), mItem.getCp_id(), true);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_ILLUST:
                            DetailDataHelper.gotoDrawerDetail(mContext, mItem.getRp_id(), mItem.getDp_id(), true);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_DAILY:
                            DetailDataHelper.gotoDailyDetail(mContext, mItem.getUd_id(), true);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_GROUP:
                            DetailDataHelper.gotoGroupDetail(mContext, mItem.getGid(), mItem.getPost_id(), true);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_WRITER:
                            DetailDataHelper.gotoWriterDetail(mContext, mItem.getRp_id(), mItem.getWp_id(), true);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_ASK:
                            gotoUtil.gotoAct(mContext, AskActivity.class, mItem.getOuid(), mItem.getOUName());
                            break;
                        case TimelineFactory.TIMELINE_TYPE_GOODS:
                            gotoUtil.gotoAct(mContext, GoodsDetailActivity.class, mItem.getZg_id());
                            break;
                    }
                    break;
                case R.id.ground_recommend_rly:
                    TimelineLikeHelper.doRecommendAll(mContext, mQueue, mItem, new TimelineLikeHelper.TimelineSuccess() {
                        @Override
                        public void onTimelineSuccess() {
                            mItem.setHaveRecommend(String.valueOf(!Boolean.valueOf(mItem.getHaveRecommend())));
                            updatePriase(v, mItem);
                        }
                    });
                    break;
                case R.id.write_cover:
                    DetailDataHelper.gotoWriterDetail(mContext, mItem.getRp_id(), mItem.getWp_id(), false);
                    break;
                case R.id.ask_container:
                    gotoUtil.gotoAct(mContext, AskActivity.class, mItem.getOuid(), mItem.getOUName());
                    break;
                default:
                    break;
            }
        }
    }

    private class OnItemClick implements View.OnClickListener {
        private Timeline mItem;

        public OnItemClick(Timeline mItem) {
            this.mItem = mItem;
        }

        @Override
        public void onClick(View v) {
            int whichType = TimelineFactory.whichType(mItem.getOtype_data(), mItem.getOtype());
            switch (v.getId()) {
                case R.id.write_item_one:
                    switch (whichType) {
                        case TimelineFactory.TIMELINE_TYPE_COSER:
                            DetailDataHelper.gotoCosDetail(mContext, mItem.getRp_id(), mItem.getCp_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_ILLUST:
                            DetailDataHelper.gotoDrawerDetail(mContext, mItem.getRp_id(), mItem.getDp_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_DAILY:
                            DetailDataHelper.gotoDailyDetail(mContext, mItem.getUd_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_WRITER:
                            DetailDataHelper.gotoWriterDetail(mContext, mItem.getRp_id(), mItem.getWp_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_GROUP:
                            DetailDataHelper.gotoGroupDetail(mContext, mItem.getGid(), mItem.getPost_id(), false);
                            break;
                        case TimelineFactory.TIMELINE_TYPE_GROUP_TEAM:
                            gotoUtil.gotoAct(mContext, NewTeamDetailActivity.class, mItem.getGid());
                            break;
                    }
                    break;
            }
        }
    }

    private void updateLike(View view, final Timeline mItem) {
        final ImageView likeNumImg = (ImageView) view.findViewById(R.id.ground_like_img);
        final TextView likeNum = (TextView) view.findViewById(R.id.ground_likenumber_tv);
        if (StringUtil.getHaveDingBoolean(mItem)) {
            isAnimation_runing = true;
            likeNumImg.setScaleY(2f);
            likeNumImg.setScaleX(2f);
            likeNumImg.setImageResource(R.drawable.frame_praise);
            AnimationDrawable drawable = (AnimationDrawable) likeNumImg.getDrawable();
            drawable.start();
            likeNumImg.postDelayed(new Runnable() {
                @Override
                public void run() {
                    likeNumImg.setScaleY(1f);
                    likeNumImg.setScaleX(1f);
                    likeNumImg.setImageResource(R.drawable.like_pink);
                    likeNum.setText(mItem.getLikeNum());
                    isAnimation_runing = false;
                }
            }, 24 * 20);
        } else {
            likeNumImg.setImageResource(R.drawable.like_grey);
            likeNum.setText(mItem.getLikeNum());
            if (mItem.getLikeNum().equals("0")) {
                likeNum.setText(mContext.getString(R.string.good));
            }
        }
    }

    private void updatePriase(View view, Timeline mItem) {
        TextView recommend = (TextView) view.findViewById(R.id.ground_recommend_tv);
        if (StringUtil.notNullEqual(mItem.getHaveRecommend(), "true")) {
            recommend.setText(mContext.getString(R.string.all_recommended));
        } else {
            recommend.setText(mContext.getString(R.string.all_recommend));
        }
    }
}
